UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vhozeeE/VRvzC4itpzEQ19pZqn8VfNiq51pXfWYAdVA=' 
WHERE 
  key_id = '22da14a607ff701531f36f0807cb0c234505135526529523fa9f353397bfe4dd' 
  AND (
    token = 'vhozeeE/VRvzC4itpzEQ19pZqn8VfNiq51pXfWYAdVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017