UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ZbzaORKmnBQHVK/aA9JA/skITVSTVOnhyQkRw67Wws='
WHERE
key_id = '789c9adeea096f5daadea6ecab6a3abc07645d98ad387e250d59b0ee24f2eaff'
AND (
token = '9ZbzaORKmnBQHVK/aA9JA/skITVSTVOnhyQkRw67Wws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)