UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qKc+BCGHmEb7Wsymhk1f8ENTzUMzpAnbXmne9XtfLzk='
WHERE
key_id = 'fbaec184807052bc425ccd59ff40b012a6ddc5e34a8b03418901d27afebef988'
AND (
token = 'qKc+BCGHmEb7Wsymhk1f8ENTzUMzpAnbXmne9XtfLzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)