UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PT5bZutSscKfMRqtRQFh1gV0rTWYeFL6f2PaqsQ2iTE='
WHERE
key_id = 'af063cef0793c9dbd17aad6a851e5ab8042b15fa2b132db1add8018067ef6909'
AND (
token = 'PT5bZutSscKfMRqtRQFh1gV0rTWYeFL6f2PaqsQ2iTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)