UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pzaGaFYaBexam+tHA7zNHHpRbmrDZ2wcK1ECouAclF0=' 
WHERE 
  key_id = '1b28467e266c4e2ea124f8804ef71f2fb034838922d4aa5b0de749ec0dfe3033' 
  AND (
    token = 'pzaGaFYaBexam+tHA7zNHHpRbmrDZ2wcK1ECouAclF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038