UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MAGgQJ6qyxtxj1LyHBsRbcjs/N0OSIE34sCirr12FRg=' 
WHERE 
  key_id = '7e920e21e594af78c111763872181367a80f22bef1f10138e6ab4f75e96d6594' 
  AND (
    token = 'MAGgQJ6qyxtxj1LyHBsRbcjs/N0OSIE34sCirr12FRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027