UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SNFXAWgeJXKJguYE8Y011T4dRAe8Mz6izHGhdqzMzDM='
WHERE
key_id = '3971c4b42d5a4ceb4c0ac21c3966a2fdc9875ca6879ebe051a87c2e958e4f094'
AND (
token = 'SNFXAWgeJXKJguYE8Y011T4dRAe8Mz6izHGhdqzMzDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)