UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '34QiqNn152TsS9vnsfqFqArcjWmltiu+GfcKndvt/v4='
WHERE
key_id = 'e3a55b96a850063a4d017a681c0e5e1073f12e78a7f4dfabdb64c41c9e60b3db'
AND (
token = '34QiqNn152TsS9vnsfqFqArcjWmltiu+GfcKndvt/v4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)