UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i8xMWcCfcK/Fanqo8Soe5t0wV0LxYPEwQBcBpAq9Xdk='
WHERE
key_id = 'ac5eee9a423a82d941ecb2207f438cdc7a3eb8ebdf7164217a09370a2d2d86fc'
AND (
token = 'i8xMWcCfcK/Fanqo8Soe5t0wV0LxYPEwQBcBpAq9Xdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)