UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '53siZNov2N8bdOa0gZCGgiorUiTdXJspTV4u0j9r4WY='
WHERE
key_id = 'a0965e66ba0c3e2a21d6a2557f021c94bfca3876648f3811278523a6853e0e6c'
AND (
token = '53siZNov2N8bdOa0gZCGgiorUiTdXJspTV4u0j9r4WY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)