UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qVL6yKmrtAPNAKuTKYX7vkhxJAiMu4ysD4F20e82uMI='
WHERE
key_id = '66483b3a284bde79289b14cb26ea1458a7995c9d343453beda6837ebfbf44d88'
AND (
token = 'qVL6yKmrtAPNAKuTKYX7vkhxJAiMu4ysD4F20e82uMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)