UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VD9lmS1l6PJm02lV7Wn9rMT9fXRZ/hvH+HUtWY5LkSk='
WHERE
key_id = '7460faca6ac05d0481b3c0230658e27523a2a0f3378c8af0739b77df9b3c4456'
AND (
token = 'VD9lmS1l6PJm02lV7Wn9rMT9fXRZ/hvH+HUtWY5LkSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)