UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J/QYbYfIgbXfsjdw7tpcjUoPrU/xnoQmka6WK5bKIwI='
WHERE
key_id = 'ecc3075022e33fe8c0cc385843f6870709f7e0d1b14885933f394d2788732fbe'
AND (
token = 'J/QYbYfIgbXfsjdw7tpcjUoPrU/xnoQmka6WK5bKIwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)