UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jQyFGTk97xal8oMFb9EHc1/ZdaG687LozPqmeggqIS4=' 
WHERE 
  key_id = '3c8f15d1d43d0c0a1f899ed912a977479fa2e2672f27d7584a2d56bbf4af4c14' 
  AND (
    token = 'jQyFGTk97xal8oMFb9EHc1/ZdaG687LozPqmeggqIS4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027