UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BA2+rEgFvy9L44Rsh/7PXWJ7vKxTQHJdLknU0SJVIso='
WHERE
key_id = 'fd158976d0b2a54eb11bbb5500270f88be84f2321723c844655d561c6503ec5f'
AND (
token = 'BA2+rEgFvy9L44Rsh/7PXWJ7vKxTQHJdLknU0SJVIso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)