UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2qOqaBaChLtbDQMvP+GTnI4Ec30v8IqMHD8Ve8SecBg='
WHERE
key_id = '55d893ff7148c5f93dc204f703cd90b1ce1c30d2652e5f8d8404fb168658ce81'
AND (
token = '2qOqaBaChLtbDQMvP+GTnI4Ec30v8IqMHD8Ve8SecBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)