UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mcgExexSMLzf9OhZc6p67qCnj8B81b7G3cWaq/qjHfs='
WHERE
key_id = 'd61c95135880788b288a6c24c5289bf4b69983e4caf97ebd8d8ee1d8dc5cbd8e'
AND (
token = 'mcgExexSMLzf9OhZc6p67qCnj8B81b7G3cWaq/qjHfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)