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

Query time 0.00021