UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '924EQ7nN1aKk9EOby6+D3ydGLhLszWTojzav7GhQz50='
WHERE
key_id = 'f2a08a805ef052f1db1ed92c2673d14a4d7a49ab59fc93c70c0bdef031142b4d'
AND (
token = '924EQ7nN1aKk9EOby6+D3ydGLhLszWTojzav7GhQz50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)