UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KlmHUE9KBu5Jkg4fCkkjLiynl0FFLGo/UrvIcm+jVHY='
WHERE
key_id = 'ff925a7aef45523fe36bdab15c09d241f2a25359adc4b68aab0a8f54cb85daa8'
AND (
token = 'KlmHUE9KBu5Jkg4fCkkjLiynl0FFLGo/UrvIcm+jVHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)