UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w1cKK5elTYRfxD8qvXOii4MVtPmuMF//psdTwaWW+G8='
WHERE
key_id = 'da233fa35cd7923dc22d40a7ddeba8c35f728fa9c67d177f1e4e87224d6d9f44'
AND (
token = 'w1cKK5elTYRfxD8qvXOii4MVtPmuMF//psdTwaWW+G8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)