UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g4NGan/IHeJPT/YA4j4IQ/lv0AkIPQ3uuA5BTTd5dXE='
WHERE
key_id = 'a8a5739859317b7081f0dbe8674ea7b78a5e37fd75ef6591e62febae34172632'
AND (
token = 'g4NGan/IHeJPT/YA4j4IQ/lv0AkIPQ3uuA5BTTd5dXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)