UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GDxjDGu03mbUaVVFBKug4zBTq70Sfu6FuCs1pTqF2hU='
WHERE
key_id = 'a655eceaa0a1681cc5c9b16d763410a8bab8b11136699ad2497bc9ad8373ad7a'
AND (
token = 'GDxjDGu03mbUaVVFBKug4zBTq70Sfu6FuCs1pTqF2hU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)