UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iLQPLwQ9siMdiOniGmLP52qP1zkE+wawIWYpclwU7jk='
WHERE
key_id = '1d88c7081315eb7b62d93f3ca42d24a5d4a438286f6857304139fa762ebdb6b7'
AND (
token = 'iLQPLwQ9siMdiOniGmLP52qP1zkE+wawIWYpclwU7jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)