UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LczXzOHgsiESxxilJEY4VL2yD79/JLVf7qGKF2K1Zh4='
WHERE
key_id = '8e011218132fb5bd9a5da6c923a88272d22279e5b9e6eefc74869f5f8c400efc'
AND (
token = 'LczXzOHgsiESxxilJEY4VL2yD79/JLVf7qGKF2K1Zh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)