UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rxpHCD3AZNRw5ci6kmuRjtXlivB146HE4mleA0ZiPGI='
WHERE
key_id = '4572794fe9bf414f0276679d24ac19b2bc9d8edaa20908d4edfef8f17f6a5f58'
AND (
token = 'rxpHCD3AZNRw5ci6kmuRjtXlivB146HE4mleA0ZiPGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)