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

Query time 0.00030