UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p+ika/STTVft3W1BcduZ/xpZCubD4qfF89pYVbbVJ3c='
WHERE
key_id = 'c6fec37b765e33881e51a5f0766087b3efa2580b251bcf22da3aad9b7a059b9d'
AND (
token = 'p+ika/STTVft3W1BcduZ/xpZCubD4qfF89pYVbbVJ3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)